<link href="./css/style.css" rel="stylesheet" type="text/css" />
<div class="main">
<div class="news">
	<p class="tt"><a>首页</a>><a>系统设置</a></p>
	<form class="setting">
		<p class="p1"><span>系统名称</span><input type="text" name="webname" placeholder="" value="{$set1[webname]}" /></p>
		
		<p class="p1"><span>运行状态</span>
			<input type="radio" name="webstate" value="1" {if($set1['webstate']==1)}checked{/if} />运行 	
			<input type="radio" name="webstate" value="0" {if($set1['webstate']==0)}checked{/if} />关闭
		</p>
		<p class='p1 px' {if($set1['webstate']==1)} style="display:none; height:auto;" {/if}><span>闭站声明</span><textarea name="content" style="width:400px; padding:5px;">{$set1[content]}</textarea></p>
		<p class="p1"><span>短信验证</span>
			<input type="radio" name="smstype" value="1" {if($set2['smstype']==1)}checked{/if} />发送 	
			<input type="radio" name="smstype" value="0" {if($set2['smstype']==0)}checked{/if} />弹出
		</p>
		<!-- <p class="p1"><span>收款码</span><input type="text" name="skpic" style="width:244px;" id='skpic' placeholder="" value="{$set2[skpic]}" /></p> -->
		<p class='bt1'><span>{$catarr[1]}</span></p>
		<ul class='gl'>			
			<li><span class='s1'>直推补贴</span><span class='s2'> <input type='text' name='ztcash' value="{$set2[ztcash]}">%</span></li>
			<li><span class='s1'>见单补贴</span><span class='s2'> <input type='text' name='jdcash' value="{$set2[jdcash]}">%</span></li>
			<li><span class='s1'>平级补贴</span><span class='s2'> <input type='text' name='pjcash' value="{$set2[pjcash]}">%</span></li>
		</ul>
		<p class='bt1'><span>{$catarr[3]}</span></p>
		<ul class='gl'>			
			<li><span class='s1'>直推补贴</span><span class='s2'> <input type='text' name='tjcash1' value="{$set2[tjcash1]}">%</span></li>
		</ul>
		<p class='bt1'><span>团队规则</span></p>
		<ul class='gl'>			
			<li><span class='s1'>{$tdarr1[1]}</span><span class='s2'> 直推<input type='text' name='td11' value="{$set2[td11]}">个{$tdarr[2]} + <input type='text' name='td12' value="{$set2[td12]}">个{$tdarr[2]}团队中不低于<input type='text' name='td13' value="{$set2[td13]}">单 管理奖<input type='text' name='tdjl1' value="{$set2[tdjl1]}">%</span></li>
			<li><span class='s1'>{$tdarr1[2]}</span><span class='s2'> 直推<input type='text' name='td2' value="{$set2[td2]}">个{$tdarr1[1]} 管理奖<input type='text' name='tdjl2' value="{$set2[tdjl2]}">%</span></li>
			<li><span class='s1'>{$tdarr1[3]}</span><span class='s2'> 直推<input type='text' name='td3' value="{$set2[td3]}">个{$tdarr1[2]} 管理奖<input type='text' name='tdjl3' value="{$set2[tdjl3]}">%</span></li>
			<li><span class='s1'>{$tdarr1[4]}</span><span class='s2'> <input type='text' name='td4' value="{$set2[td4]}">个部门出现{$tdarr1[3]} 管理奖<input type='text' name='tdjl4' value="{$set2[tdjl4]}">%</span></li>
			<li><span class='s1'>{$tdarr1[5]}</span><span class='s2'> <input type='text' name='td5' value="{$set2[td5]}">个部门出现{$tdarr1[4]} 管理奖<input type='text' name='tdjl5' value="{$set2[tdjl5]}">%</span></li>
			<li><span class='s1'>{$tdarr1[6]}</span><span class='s2'> <input type='text' name='td6' value="{$set2[td6]}">个部门出现{$tdarr1[5]} 管理奖<input type='text' name='tdjl6' value="{$set2[tdjl6]}">% 平台业绩<input type='text' name='fh6' value="{$set2[fh6]}">%的分红奖励</span></li>
			<li><span class='s1'>{$tdarr1[7]}</span><span class='s2'> <input type='text' name='td7' value="{$set2[td7]}">个部门出现{$tdarr1[6]} 管理奖<input type='text' name='tdjl7' value="{$set2[tdjl7]}">% 平台业绩<input type='text' name='fh7' value="{$set2[fh7]}">%的分红奖励</span></li>

		</ul>		
		<p class='bt1'><span>伯乐奖</span></p>
		<ul class='gl'>			
			<li><span class='s2'> <input type='text' name='ceng1' value="{$set2[ceng1]}">代内管理奖的<input type='text' name='tdpj1' value="{$set2[tdpj1]}">%</span></li>
			<li><span class='s2'> <input type='text' name='ceng2' value="{$set2[ceng2]}">代内管理奖的<input type='text' name='tdpj2' value="{$set2[tdpj2]}">%</span></li>
			<li><span class='s2'> <input type='text' name='ceng3' value="{$set2[ceng3]}">代内管理奖的<input type='text' name='tdpj3' value="{$set2[tdpj3]}">%</span></li>
			<li><span class='s2'> <input type='text' name='ceng4' value="{$set2[ceng4]}">代内管理奖的<input type='text' name='tdpj4' value="{$set2[tdpj4]}">%</span></li>
		</ul>

		<p class='bt1'><span>代理补贴</span></p>
		<ul class='gl'>			
			<li><span class='s1'>省级代理</span><span class='s2'> <input type='text' name='dlcash1' value="{$set2[dlcash1]}">%</span></li>
			<li><span class='s1'>市级代理</span><span class='s2'> <input type='text' name='dlcash2' value="{$set2[dlcash2]}">%</span></li>
			<li><span class='s1'>区县代理</span><span class='s2'> <input type='text' name='dlcash3' value="{$set2[dlcash3]}">%</span></li>
		</ul>		
		<p class='bt1'><span>收件地址</span></p>
		<ul class='gl'>			
			<li><span class='s1'>收件人</span><span class='s2'> <input type='text' name='tname' value="{$set2[tname]}" style="width:120px;"></span></li>
			<li><span class='s1'>联系电话</span><span class='s2'> <input type='text' name='phone' value="{$set2[phone]}" style="width:100px;"></span></li>
			<li><span class='s1'>收件地址</span><span class='s2'> <input type='text' name='address' value="{$set2[address]}" style="width:300px;"></span></li>
		</ul>	
		<p class='bt1'><span>提现规则</span></p>
		<ul class='gl'>
			<li><span class='s1'>提现限制</span><span class='s2'><input type='text' name='txlimit' value="{$set2[txlimit]}">的整数倍 税费<input type='text' name='tixian' value="{$set2[tixian]}">% 手续费<input type='text' name='tixian1' value="{$set2[tixian1]}">%</span></li>
		</ul>		
		<button type="button" onclick="setting();">确认修改</button>
	</form>
	<!-- <form id="upfile" style='top:168px; left:269px;'><input type="file" name="file" id="file" onchange="sc(this);" style="width:60px;" /><span>上传</span></form> -->
	<script src="./js/jquery.js"></script>
	<script>
        function sc(){
			var animateimg = $("#file").val(); //获取上传的图片名 带//  
			var imgarr=animateimg.split('\\'); //分割  
			var myimg=imgarr[imgarr.length-1]; //去掉 // 获取图片名  
			var houzui = myimg.lastIndexOf('.'); //获取 . 出现的位置  
			var ext = myimg.substring(houzui, myimg.length).toUpperCase();  //切割 . 获取文件后缀  
			  
			var file = $('#file').get(0).files[0]; //获取上传的文件  
			var fileSize = file.size;           //获取上传的文件大小  
			var maxSize = 2048576;              //最大1MB  
			if(ext !='.PNG' && ext !='.GIF' && ext !='.JPG' && ext !='.JPEG' && ext !='.BMP'){  
				alert('文件类型错误,请上传图片类型');  
				return false;  
			}else if(parseInt(fileSize) >= parseInt(maxSize)){  
				alert('上传的文件不能超过1MB');  
				return false;  
			}else{    
				var data = new FormData($('#upfile')[0]);   
				$.ajax({    
					url: "uppic.php",   
					type: 'POST',    
					data: data,    
					dataType: 'JSON',    
					cache: false,    
					processData: false,    
					contentType: false    
				}).done(function(ret){    
					if(ret['isSuccess']){
						$("#skpic").val(ret['f']);
					}else{    
						alert('上传失败');  
					}    
				});    
				return false;  
			}
		}
		$("input[type=radio]").on("click",function(){
			index = $('input[type=radio]:checked').val();
			if(index==1){
				$(".px").hide();
			}
			if(index==0){
				$(".px").show();
			}
		});
		function setting(){
				$.ajax({
					type:"post",
					dataType:"json",
					url:"/Moudel.php?m=a&a=setting",
					data:$(".setting").serialize(),
					success:function(d){
						if(d[0]==0){
							alert(d[1]);
						}
						else{
							alert(d[1]);
							window.location.href='setting.php';
						}
					}
				});
			}
		h1 = $(".main").height();
		h2 = $(".news").height();
		if(h2>h1){
			$(".main").css("height","auto");
		}
	</script>
	
</div>
</div>